#ifndef WXCRAFTERCB_H
#define WXCRAFTERCB_H

#include <cbplugin.h> #include <wx/treebase.h>
#include <wx/event.h>
#include "wxcLib/wxcConnector.h"
#include <vector>
#include <wx/filename.h>

class wxCrafterTab;
class FileTreeData;
class cbTreeCtrl;

class wxCrafterCB : public cbPlugin
{
    cbTreeCtrl* m_projectTree;
    wxcConnector m_connector;
    wxCrafterTab* m_tabView;

protected:
    // Event handlers
    void OnTreeItemActivated(wxTreeEvent& event);
    void OnFilesGenerated(wxCommandEvent &event);

    // Helpers
    bool IsWxCrafterFile(const FileTreeData* ftd) const;
    wxArrayString DoGetAllProjectTargets(cbProject* proj) const;
    FileTreeData* DoGetSelectedItem();

public:
    
    bool EnsureWxCrafterIsRunning();

    wxcConnector& GetConnector() {
        return m_connector;
    }
    
    
    wxCrafterCB();
    
    virtual ~wxCrafterCB();


    
    virtual void BuildMenu(wxMenuBar* menuBar);

    
    virtual void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = 0);

    
    virtual bool BuildToolBar(wxToolBar* toolBar) {
        return false;
    }
protected:
    
    virtual void OnAttach();

    
    virtual void OnRelease(bool appShutDown);
};

#endif // WXCRAFTERCB_H
